home *** CD-ROM | disk | FTP | other *** search
/ Digitalfoto 118 / Digitalfoto 118.iso / mac / programas / 00 / start.swf / scripts / __Packages / com / robertpenner / easing / Expo.as < prev    next >
Text File  |  2009-11-16  |  982b  |  47 lines

  1. class com.robertpenner.easing.Expo
  2. {
  3.    function Expo()
  4.    {
  5.    }
  6.    static function easeIn(t, b, c, d)
  7.    {
  8.       return t != 0 ? c * Math.pow(2,10 * (t / d - 1)) + b : b;
  9.    }
  10.    static function easeOut(t, b, c, d)
  11.    {
  12.       return t != d ? c * (- Math.pow(2,-10 * t / d) + 1) + b : b + c;
  13.    }
  14.    static function easeInOut(t, b, c, d)
  15.    {
  16.       if(t == 0)
  17.       {
  18.          return b;
  19.       }
  20.       if(t == d)
  21.       {
  22.          return b + c;
  23.       }
  24.       if((t /= d / 2) < 1)
  25.       {
  26.          return c / 2 * Math.pow(2,10 * (t - 1)) + b;
  27.       }
  28.       return c / 2 * (- Math.pow(2,-10 * (t = t - 1)) + 2) + b;
  29.    }
  30.    static function easeOutIn(t, b, c, d)
  31.    {
  32.       if(t == 0)
  33.       {
  34.          return b;
  35.       }
  36.       if(t == d)
  37.       {
  38.          return b + c;
  39.       }
  40.       if((t /= d / 2) < 1)
  41.       {
  42.          return c / 2 * (- Math.pow(2,-10 * t) + 1) + b;
  43.       }
  44.       return c / 2 * (Math.pow(2,10 * (t - 2)) + 1) + b;
  45.    }
  46. }
  47.